#include <stdio.h>

int main()
{
	int size = 0;
	int data[100] = {0};

	printf("请输入多项式非零项系数和指数: \n");
	while(1){
		scanf("%d", &data[size++]);
		if(getchar() == '\n'){
			break;
		}
	}
	for(int i = 0;i < size - 1; ){
		if(data[i+1] == 0){
			i += 2;
			continue;
		}
		printf("%s%d %d", i==0?"":" ", data[i] * data[i+1], data[i+1] - 1);
		i += 2;
	}
	printf("\n");
	return 0;
}
